package org.poem.util;

/**
 * http://blog.itpub.net/25379809/viewspace-703994/
 */
public class SqlServerToMysqlDataType {
    /**
     * @param dataType
     * @return
     */
    public static String sqlServerDataTypeToMysql(String dataType) {
        switch (dataType) {
            case "binary":
                return "binary";
            case "bit":
                return "bit";
            case "char":
                return "char";
            case "date":
                return "date";
            case "datetime":
            case "datetime2":
            case "datetimeoffset":
            case "smalldatetime":
                return "datetime";
            case "decimal":
            case "money":
                return "decimal";
            case "float":
                return "float";
            case "nchar":
            case "nvarchar":
            case "varchar":
                return "varchar";
            case "numeric":
            case "smallmoney":
                return "numeric";
            case "text":
            case "sql_variant":
                return "text";
            case "timestamp":
                return "timestamp";
            case "varbinary":
                return "varbinary";
            case "tinyint":
            case "smallint":
            case "int":
                return "int";
            case "bigint":
                return "bigint";
        }
        return "varchar";
    }
}
